package org.lboot.s3.test;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.lboot.s3.client.S3Client;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("s3")
@AllArgsConstructor
@Api(tags = "版本方法测试")
public class S3VersionTestController {
    S3Client s3Client;
    @GetMapping("object/{bucketName}/{objectName}/version")
    @ApiOperation(value = "对象版本信息")
    public Object objectInfo(@PathVariable("bucketName") String bucketName, @PathVariable("objectName") String objectName){
        return s3Client.listObjectVersions(bucketName, objectName);
    }
}
